<template>
    <view>
        <u-popup :show="recordShow" mode="bottom" bgColor="transparent">
            <view class="tanchuang_box"
                 :style="{backgroundImage:' url(' + bgImg + ')'}"
                @touchmove.stop.prevent="prevent">
                <view class="title_box"
                 :style="{backgroundImage:' url(' + bgTitle + ')'}"></view>
                <view class="close_guanbi_box" @click="hidePopup"
                :style="{backgroundImage:' url(' + gbImg + ')'}"></view>

                <scroll-view class="haudongquyu_nox" scroll-y v-if="rewardList.length > 0">

                    <view class="dange_boxjilu" v-for="(item, index) in rewardList" :key="index" :style="{background:tiaoBg}">
                        <view class="touxiang_box">
                            <image :src="item.avatar" mode="scaleToFill" />
                            <view class="touxiangkuang_box" v-if="item.level_id > 0">
                                <image
                                    :src="'https://morgan.dingxians.cn/static/txk/' + (item.level_id >= 1 && item.level_id <= 4 ? '1_4' : item.level_id >= 5 && item.level_id <= 8 ? '5_8' : item.level_id >= 9 && item.level_id <= 12 ? '9_12' : item.level_id >= 13 && item.level_id <= 16 ? '13_16' : '17_20') + '.png'"
                                    mode="widthFix" />
                            </view>
                        </view>
                        <view class="name_shaop_box">
                            <view class="t_1_box">
                                <view class="left_name_box">{{ item.nickname }}</view>
                                <view class="rt_level_name_box">
                                    <image
                                        :src="'https://morgan.dingxians.cn/static/user_levelid/' + item.level_id + '.png'"
                                        mode="heightFix" />
                                </view>
                            </view>
                            <view class="b_2_box">{{ item.created_at }}</view>
                        </view>
                        <view class="right_boxss" v-if="xianshiType == 1">
                            <view class="shop_dengjibox">{{ item.box_prize_level_name }}</view>
                            <view class="shijian_box">{{ item.box_prize_name }}</view>
                        </view>
                        <view class="right_boxss" v-else>
                            <view class="shop_dengjibox">{{ item.level_name }}</view>
                            <view class="shijian_box">{{ item.goods_name }}</view>
                        </view>
                    </view>
                </scroll-view>

                <empty v-else></empty>
            </view>
        </u-popup>

    </view>
</template>
<script>
export default {
    props: {
        recordShow: {
            type: Boolean,
            default: false
        },
        rewardList: {
            type: Array,
            default: []
        },
        bgImg:{
            type:String,
            default:'https://morgan.dingxians.cn/static/btm1.png'
        },
        bgTitle:{
            type:String,
            default:'https://morgan.dingxians.cn/static/recordDrwa/2.png'
        },
        gbImg:{
            type:String,
            default:'https://morgan.dingxians.cn/static/recordDrwa/3.png'
        },
        tiaoBg:{
            type:String,
            default:'rgba(120, 9, 9, .5)'
        },
        xianshiType:{
            trpe:String,
            default:'1'
        }
    },
    methods: {
        hidePopup() {
            this.$emit('handlePopup')
        }
    }
}
</script>
<style lang="scss" scoped>
.tanchuang_box {
    width: 750rpx;
    height: 1000rpx;
    background-size: 100% 100%;
    box-sizing: border-box;
    padding-top: 45rpx;
    position: relative;


    .title_box {
        width: 442rpx;
        height: 66rpx;
        background-size: 100% 100%;
        margin: auto;
        margin-bottom: 34rpx;
    }

    .close_guanbi_box {
        position: absolute;
        width: 72rpx;
        height: 72rpx;
        background-size: 100% 100%;
        top: 41rpx;
        right: 21rpx;
    }

    .haudongquyu_nox {
        width: 100%;
        height: 840rpx;
        box-sizing: border-box;
        padding: 0 5rpx;
        overflow: hidden;
        overflow-y: auto;

        .dange_boxjilu {
            width: 740rpx;
            height: 100rpx;
            margin: auto;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            margin-bottom: 41rpx;
            box-sizing: border-box;
            padding: 0 20rpx;
            position: relative;

            .touxiang_box {
                width: 80rpx;
                height: 80rpx;
                border-radius: 50%;
                margin-right: 30rpx;
                position: relative;

                .touxiangkuang_box {
                    width: 100rpx;
                    height: 100rpx;
                    left: -13rpx;
                    top: -10rpx;
                    position: absolute;

                    image {
                        width: 100%;
                        height: 100%;
                    }
                }

                image {
                    width: 100%;
                    height: 100%;
                    border-radius: 50%;
                }
            }

            .name_shaop_box {
                height: 100rpx;

                .t_1_box {
                    display: flex;
                    justify-content: flex-start;

                    .left_name_box {
                        height: 50rpx;
                        font-family: PingFang SC;
                        font-weight: bold;
                        font-size: 24rpx;
                        color: #F6F4FF;
                        line-height: 50rpx;
                        margin-right: 20rpx;
                    }

                    .rt_level_name_box {
                        box-sizing: border-box;
                        padding-top: 5rpx;
                        height: 39rpx;

                        image {
                            height: 39rpx;
                        }

                    }
                }

                .b_2_box {
                    height: 50rpx;
                    font-family: PingFang SC;
                    // font-weight: bold;
                    font-size: 22rpx;
                    color: #F6F4FF;
                    line-height: 50rpx;
                    text-align: center;
                }


            }

            .right_boxss {
                position: absolute;
                right: 30rpx;
                height: 100rpx;

                .shop_dengjibox {
                    height: 50rpx;
                    font-family: text1;
                    font-weight: bold;
                    font-size: 28rpx;
                    color: #FFFFFF;
                    line-height: 50rpx;
                    text-align: right;
                }

                .shijian_box {
                    width: 300rpx;
                    height: 50rpx;
                    text-align: right;
                    font-family: PingFang SC;
                    // font-weight: bold;
                    font-size: 22rpx;
                    color: #F6F4FF;
                    line-height: 50rpx;
                    text-overflow: ellipsis;
                    overflow: hidden;
                    white-space: nowrap;
                }
            }

        }
    }
}
</style>